import junit.framework.TestCase;
import android.cs2340UDT.*;
import java.io.*;
import java.util.*;
import android.content.Context;
import android.test.AndroidTestCase;


public class JosephTest extends AndroidTestCase {
	
	//White Box Test
	public void testCurrentItem() {
		Manager aManager = new Manager();
		Item anItem1 = new Item("Des", "Loc", "DD", "com");
		aManager.createNewList("A List");
		aManager.addItemToCurrentList(anItem1);
		assertEquals(aManager.getCurrentItem(), anItem1);
		Item anItem2 = new Item("Des2", "Loc2", "DD2", "com2");
		aManager.updateCurrentItem(anItem2);
		assertEquals(aManager.getCurrentItem(), anItem2);		
	}
	
	//Black Box Test
	public void tesUser() {
		Manager aManager = new Manager();
		User aUser = new User("Name", "userName", "password", "email", "date", aManager);
		//Context aCon = new Context();
		Security sec = new Security(this.getContext());
		assertFalse("Password matches", aUser.checkPassword("wrong password"));
		assertTrue("Password mismatch", aUser.checkPassword("password"));
		sec.createUser("Name", "userName", "password", "email", "date");
		assertTrue("Name and password matches", sec.checkLogin("Name", "password"));
		assertFalse("Name or password mismatch", sec.checkLogin("aName", "password"));
	}

}
